import { createApp } from 'vue'
// App
import App from './App.vue'
// global css
import '@/assets/style/common.scss'
// element-plus
import ElementPlus from 'element-plus'
// element css
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// custom element dark css
import "@/assets/style/element-dark.scss";
// custom element css
import "@/assets/style/element.scss";
// element icons
import * as Icons from "@element-plus/icons-vue";
// custom directives
import directives from "@/directives/index";
// router
import router from "@/routers";
// pinia store
import pinia from "@/stores";
// i18n
import VueI18n from "@/language/i18n.ts";
// errorHandler
import errorHandler from "@/helper/errorHandler";

// create app
const app = createApp(App)
app.config.errorHandler = errorHandler;

// register the element Icons component
Object.keys(Icons).forEach(key => {
    app.component(key, Icons[key as keyof typeof Icons]);
});

app.use(ElementPlus).use(directives).use(router).use(pinia).use(VueI18n).mount('#app')
